from openai import OpenAI
import dotenv
import os

dotenv.load_dotenv()
client = OpenAI(api_key=os.getenv("OPENAI_API_KEY"), base_url=os.getenv("BASE_URL"))

response = client.embeddings.create(
    # model="text-embedding-3-small",
    model=os.getenv("MODEL_NAME"),
    input="秦孝公",
    encoding_format="float",
)

embedding = response.data[0].embedding
print(embedding)